<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<jsp:useBean id="member" class="oneroom.admin.member.MemberDao" scope="page"/>
<jsp:useBean id="code" class="oneroom.admin.code.codeDao" scope="page"/>
<%@ page import="oneroom.admin.member.MemberModel" %>
<%@ page import="oneroom.admin.code.codeModel" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.HashMap"%>
<%@ page import="java.util.List" %>
<%
	HashMap	paramMap = new HashMap();
	String	pageName = "list.jsp";
	int		giSelectPage  	= Integer.parseInt(request.getParameter("txtSelectPage") == null ? "0" :request.getParameter("txtSelectPage"));			//현재 선택된 페이지 저장
	int		giSelectBlock 	= Integer.parseInt(request.getParameter("txtSelectBlock") == null ? "0" :request.getParameter("txtSelectBlock"));			//현재 선택된 블락페이지 저장
	String	searchGubn		= request.getParameter("searchGubn") == null ? "" : request.getParameter("searchGubn");
	String	searchValue		= request.getParameter("searchValue") == null ? "" : request.getParameter("searchValue");
	String	id				= request.getParameter("id") == null ? "" : request.getParameter("id");
	
	paramMap.put("id",id);
	
	ArrayList returnList	=  member.getView(paramMap);
	MemberModel model	= new MemberModel();
	List list1 = code.getDtlList("100");
	List list2 = code.getDtlList("101");
	if(returnList != null && returnList.size() > 0){
		model = (MemberModel)returnList.get(0);		
	}
	
	String mode = request.getParameter("mode") == null ? "I" : request.getParameter("mode");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<title>회원관리</title>
<script type="text/javascript" src="/admin/js/default.js"></script>
<script type="text/javascript" src="/admin/js/jquery-1.3.2.min.js"></script>
<link href="/admin/css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
$(document).ready(function(){
	$('#lstBtn').click(function() {
		window.location="list.jsp";
	});
	$('#delBtn').click(function() {
		if (confirm('삭제하시겠습니까?')) {
			var f = document.getElementById("frm");
			f.mode.value ="D";
			f.action = "dbx.jsp";
			f.submit();
		}		
	});
});
//-->
</script>
</head>
<body>
<!-- Header  Start -->
<div id="bodywrap">
<div class="all-wrap">
<%@ include file="/admin/common/top.jsp" %>
<div id="right-wrap">
<%@ include file="/admin/common/navi.jsp" %>
<!--Contents Start-->
<div id="content">
<div class="path"><span>home</span> >  회원관리 </div>
<h4>회원</h4>
<p class="sub-text">회원 관리 하실 수 있습니다.</p>

<form name="frm" id="frm" action="write.jsp" method="post" >
<input type="hidden" name="mode" value="U" />
<input type="hidden" name="searchGubn" value="<%=searchGubn %>" />
<input type="hidden" name="searchValue" value="<%=searchValue %>" />
<input type="hidden" name="txtSelectPage" value="<%=giSelectPage %>" />
<input type="hidden" name="txtSelectBlock" value="<%=giSelectBlock %>" />
<input type="hidden" name="idx" value="<%=model.getIdx() %>" />
<input type="hidden" name="id" value="<%=model.getId() %>" />
<table class="view-normal" cellpadding="0" cellspacing="0" summary="이벤트" >
        <caption>회원</caption>
            <col width="70px" />
            <col width="90px" />  
            <col width="40px" />  
            <col /> 
          <tbody>
			<tr>
              <th scope="row" >ID</th>
              <td style="width:350px;"><%=model.getId() %></td>
              <th scope="row" >등록일</th>
              <td><%=model.getCreatedate() %></td>              
            </tr>
            <tr>
              <th scope="row" >사용자 구분</th>
              <td colspan="3">
		        <select id="select-grade" class="selectMain" style="width: 120px;" name="authorize" disabled="disabled">
				<%
				for(int i = 0; i<list1.size(); i++){
					codeModel codemodel = (codeModel)list1.get(i);
					
				%>
				      <option value="<%=codemodel.getCode() %>" <%if(codemodel.getCode().equals(model.getAuthorize())){%>selected="selected"<%}%>><%=codemodel.getCodename()%></option>
				<%
				} 
				%> 	
				</select>             
            </tr>             
			<tr>
              <th scope="row" >이름</th>
              <td colspan="3"><%=model.getName() %></td>
            </tr>
            <tr>
              <th scope="row" >비밀번호</th>
              <td colspan="3">******</td>              
            </tr>            
            <tr>
              <th scope="row" >전화번호</th>
              <td colspan="3"><%=model.getTel() %></td>              
            </tr>            
            <tr>
              <th scope="row" >핸드폰</th>
              <td colspan="3"><%=model.getHp() %></td>              
            </tr>            
            <tr>
              <th scope="row" >사용자등급</th>
              <td colspan="3">
		        <select id="select-grade" class="selectMain" style="width: 80px;" name="grade" disabled="disabled">
			<%
			for(int i = 0; i<list2.size(); i++){
				codeModel codemodel = (codeModel)list2.get(i);
				
			%>
			      <option value="<%=codemodel.getCode() %>" <%if(codemodel.getCode().equals(model.getGrade())){%>selected="selected"<%}%>><%=codemodel.getCodename()%></option>
			<%
			} 
			%> 		        
				</select>
			  </td>              
            </tr>            
            <tr>
              <th scope="row" >e-mail</th>
              <td colspan="3"><%=model.getEmail() %></td>              
            </tr>            
            <tr>
              <th scope="row" >탈퇴여부</th>
              <td colspan="3"><% if(model.getUseyn().equals("Y")){%>가입<%}else{ %>탈퇴<%} %></td>              
            </tr>            
          </tbody>       
</table>
<div class="btn-all-align2 pd-b20">
<span class="btn-align"><input type="button" value="목록" class="btn-bg-gray"  id="lstBtn" /></span>
<span class="btn-align"><input type="submit" value="수정" class="btn-bg-gray"  /></span>
<span class="btn-align"><input type="button" value="삭제" class="btn-bg-gray"  id="delBtn" /></span>
</div>
</form>
<!--Contents End-->
</div>
</div>
</div>
<!--Footer Start-->
<%@ include file="/admin/common/bottom.jsp" %>
<!--Footer End-->
</body>
</html>